xPres <- as.Date.character(c("2004-6-01", "1990-6-01", "1979-6-01", "1996-6-01",
"1958-6-01", "1975-6-01", "1966-6-01", "1962-6-01",
"1970-6-01", "2012-6-01", "1984-6-01", "1942-6-01",
"1948-6-01", "2019-6-01"))
yPres <- c(98)
labelPres=c("Bush Jr.", "Bush Sr.", "Carter", "Clinton",
"Eisenhower", "Ford", "Johnson", "Kennedy",
"Nixon", "Obama", "Reagan", "Roosevelt",
"Truman", "Trump")
fontLabel <- list(family="Arial Black", size=10)
combined.plot <- combined.plot %>%
layout(annotations = list(x = xPres , y = yPres,
text = labelPres, font=fontLabel,
xref='data', yref='data',
textangle=-45, showarrow = FALSE)
)
Note: I was not able to set different colors for the label text without calling layout 14 times. Any suggestions?